this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,n,i,a,s){"use strict";var r,o,l,c,d,g,u,p;var h="warning";var m=function(e){babelHelpers.inherits(t,e);function t(e){var n;babelHelpers.classCallCheck(this,t);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));n.setEventNamespace("BX.Landing.UI.Card.MessageCard");i.Dom.addClass(n.getLayout(),"landing-ui-card-message");n.onCloseClick=n.onCloseClick.bind(babelHelpers.assertThisInitialized(n));if(i.Type.isStringFilled(n.options.context)){switch(n.options.context){case h:i.Dom.addClass(n.getLayout(),"landing-ui-card-message-context-warning");break}}if(n.options.angle===false){i.Dom.addClass(n.getLayout(),"landing-ui-card-message-without-angle")}if(i.Type.isStringFilled(n.options.icon)){i.Dom.append(n.getIcon(),n.getHeader())}i.Dom.append(n.getTitle(),n.getHeader());i.Dom.append(n.getDescription(),n.getBody());if(n.options.closeable!==false){i.Dom.append(n.getCloseButton(),n.getLayout())}if(n.options.hideActions!==true||n.options.more){i.Dom.append(n.getActionsContainer(),n.getLayout())}if(n.isAllowRestoreState()){var a=t.cache.get(n.options.id,{shown:true});if(a.shown){n.show()}else{n.hide()}}return n}babelHelpers.createClass(t,[{key:"isAllowRestoreState",value:function e(){return this.options.restoreState&&this.options.id}},{key:"getIcon",value:function e(){var t=this;return this.cache.remember("icon",(function(){return i.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card-message-icon" style="background-image: url(',')"></div>\n\t\t\t'])),t.options.icon)}))}},{key:"getTitle",value:function e(){var t=this;return this.cache.remember("title",(function(){return i.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card-message-title">',"</div>\n\t\t\t"])),t.options.header)}))}},{key:"getDescription",value:function e(){var t=this;return this.cache.remember("description",(function(){return i.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card-message-description">',"</div>\n\t\t\t"])),t.options.description)}))}},{key:"getCloseButton",value:function e(){var t=this;return this.cache.remember("closeButton",(function(){return i.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div \n\t\t\t\t\tclass="landing-ui-card-message-close-button" \n\t\t\t\t\tonclick="','"\n\t\t\t\t\ttitle="','"\n\t\t\t\t></div>\n\t\t\t'])),t.onCloseClick,s.Loc.getMessage("LANDING_MESSAGE_CARD_HIDE_MSGVER_1"))}))}},{key:"onCloseClick",value:function e(n){n.preventDefault();this.hide();this.emit("onClose");t.cache.set(this.options.id,{shown:false})}},{key:"getActionsContainer",value:function e(){var t=this;return this.cache.remember("actionsContainer",(function(){return i.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card-message-actions">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),t.options.closeable!==false?t.getCloseLink():"",t.options.more?t.getReedMoreLink():"")}))}},{key:"getCloseLink",value:function e(){var t=this;return this.cache.remember("closeLink",(function(){return i.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="ui-link ui-link-secondary ui-link-dashed landing-ui-card-message-close-link" onclick="','">\n\t\t\t\t\t',"\n\t\t\t\t</span>\n\t\t\t"])),t.onCloseClick,s.Loc.getMessage("LANDING_MESSAGE_CARD_HIDE_MSGVER_1"))}))}},{key:"getReedMoreLink",value:function e(){var t=this;return this.cache.remember("readMoreButton",(function(){if(i.Type.isStringFilled(t.options.more)){return i.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<a href="','" target="_blank" class="ui-link ui-link-secondary ui-link-dashed landing-ui-card-read-more-link">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</a>\n\t\t\t\t"])),i.Text.encode(t.options.more),s.Loc.getMessage("LANDING_MESSAGE_CARD_READ_MORE"))}return i.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="ui-link ui-link-secondary ui-link-dashed landing-ui-card-read-more-link" onclick="','">\n\t\t\t\t\t',"\n\t\t\t\t</span>\n\t\t\t"])),t.options.more,s.Loc.getMessage("LANDING_MESSAGE_CARD_READ_MORE"))}))}},{key:"onClick",value:function e(){this.onClickHandler(this);this.emit("onClick")}}]);return t}(a.BaseCard);babelHelpers.defineProperty(m,"cache",new i.Cache.MemoryCache);e.MessageCard=m})(this.BX.Landing.UI.Card=this.BX.Landing.UI.Card||{},BX,BX,BX,BX.Landing.UI.Card,BX.Landing);
//# sourceMappingURL=messagecard.bundle.map.js